﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DeploymentMaxLib
{
    public static class Handler
    {
        public static ActionBase GetActionByActionType(ActionType pActionType)
        {
            if (pActionType == ActionType.ActionNone) return null;
            var typeString = string.Format("{0}.{1}.{3}", "DeploymentMaxLib", "Actions", pActionType.ToString());
            var type = Type.GetType(typeString);
            if (type == null) throw new Exception(string.Format("Type {0} was not found.", typeString));
            return (ActionBase)Activator.CreateInstance(type);
        }
    }
}
